package com.cloud.stock.api.controller;

import com.cloud.stock.api.fegin.StockClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/stock")
public class StockController {

    @Resource
    private StockClient stockClient;

    @GetMapping("/decr/{productId}")
    public String decr(@PathVariable("productId") int productId) {
        return stockClient.decr(productId);
    }

}
